package com.acceptable.qucun.file.entity;

import com.acceptable.qucun.file.entity.template.TemplateFile;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Collections;
import java.util.List;

@ToString
@AllArgsConstructor
@NoArgsConstructor
public class TemplateDict extends TemplateFile {
    private List<TemplateFile> subFileList;

    public TemplateDict(TemplateFile file){
        super.setFileId(file.getFileId());
        super.setFileMd5(file.getFileMd5());
        super.setFileName(file.getFileName());
        super.setFileSize(file.getFileSize());

        super.setDeleted(file.getDeleted());
        super.setDict(file.getDict());

        super.setPid(file.getPid());
        super.setUserId(file.getUserId());

        super.setCreateTime(file.getCreateTime());
        super.setLastModifyTime(file.getLastModifyTime());

        subFileList = Collections.emptyList();
    }

    public void setSubFileList(List<TemplateFile> subFileList) {
        this.subFileList = subFileList;
    }

    @Override
    public List<TemplateFile> getSubFileList() {
        return subFileList;
    }
}
